<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/layui/layui_2/layui/css/layui.css"
	media="all">
</head>
<body>
	<br/>
	<div id='update_dept_div'>
	  	<form class="layui-form" action="${pageContext.request.contextPath }/empAction_query" id="query_form">
	  		<div class="layui-form-item">
			    <label class="layui-form-label">产品类别：</label>
			    <div class="layui-input-inline">
			    	<select name="e_sex">
					    <option value="">--请选择--</option>
						<option value="1">食物类</option>
						<option value="0">饮用类</option>
				    </select>
			    </div>
				<label class="layui-form-label">产品名称：</label>
				<div class="layui-input-inline">
					<select name="e_sex">
					    <option value="">--请选择--</option>
						<option value="1">大米</option>
						<option value="0">可乐</option>
				    </select>
				</div>
				<label class="layui-form-label">产地：</label>
				<div class="layui-input-inline">
					<select name="dept.p_id">
						<option value="">--请选择--</option>
						<option value="0">长沙</option>
                        <option value="1">广州</option>
                        <option value="2">湘潭</option>
					</select>
				</div>
				<button class="layui-btn" id="query"><i class="layui-icon">&#xe615;</i>查询</button>
		  	</div>
	  	</form>
	</div>
	<table class="layui-table" id="emp_query_table" lay-filter="emp_query_table"></table>
	<script src="${pageContext.request.contextPath }/layui/layui_2/layui/layui.js"></script>
	<script>
		layui.use(['form','element','jquery','table','layer'], function() {
			var form = layui.form,
				element = layui.element,
				$ = layui.jquery,
				table = layui.table,
				layer = layui.layer;
			
			var cols = [ [ {
				field : 'e_id',
				align : 'center',
				title : '编号',
				width : 180
			},{
				field : 'PName',
				align : 'center',
				title : '产品类别',
				width : 210
			}, {
				field : 'e_loginname',
				title : '产品名',
				align : 'center',
				width : 220
			}, {
				field : 'e_psw',
				align : 'center',
				title : '产地',
				width : 220
			}, {
				field : 'e_img',
				align : 'center',
				title : '规格',
				width : 200
			}, {
				field : 'e_sex',
				align : 'center',
				title : '出入库查询',
				width : 220
			}, {
				field : 'e_flag',
				align : 'center',
				title : '剩余数量',
				width : 220
			}, {
				field : 'e_is',
				title : '入库',
				align : 'center',
				width : 230,
				templet: '#is'
			} ] ];
			
			//方法级渲染
			table.render({
				elem : '#emp_query_table',
				url : '${pageContext.request.contextPath }/empAction_findByPage',
				cols : cols,
				id : 'testReload',
				limit: 10,
			    limits: [10, 30, 50],
				page : true
			});
			
			$("#query").click(function(){
				$("#query_form").submit();
			})			
		})
		
	</script>
	<script type="text/html" id="is">
  		{{#  if(d.e_is = 1){ }}
    		在职
  		{{#  } else { }}
    		离职
  		{{#  } }}
	</script>
</body>
</html>